<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>后台管理系统</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
</head>
<body>

<header th:fragment="header">
  <nav class="navbar navbar-default">
    <div class="container-fluid">
      <div class="navbar-header">
        <a class="navbar-brand" href="#">后台管理系统</a>
      </div>
    </div>
  </nav>
</header>

<div class="sidebar" th:fragment="sidebar">
  <div id="currentUserDiv">
    <span id="currentUserSpan"></span>
  </div>
  <a href="/index">首页</a>
  <a href="/users">用户管理</a>
  <a href="/hospitals">医院管理</a>
  <a href="/doctors">医生管理</a>
  <a href="/orders">订单管理</a>
  <a href="/checkitems">体检项目管理</a>
  <a href="/setmeals">体检套餐管理</a>
  <a href="/reports">体检报告管理</a>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
  $(document).ready(function () {
    // 页面加载时发送 AJAX 请求获取当前用户信息
    $.get("/currentUser", function (data) {
      $('#currentUserSpan').text(data); // 将返回的用户信息更新到页面
    });
  });
</script>
</body>
</html>
